﻿
@model ETL.Web.Models.DashboardViewModel
@{
    ViewBag.Title = "Engineer Time Logging";
}
<link rel="stylesheet" type="text/css" href="../../Content/webgrid.css" />

<!--   Ajax - js event functions   -->
<script src="../../Scripts/index-events.js" type="text/javascript"></script>
<script src="../../Scripts/index-functions.js" type="text/javascript"></script>
<!--   Js event functions   -->


<script type="text/javascript">
    $(document).ready(function () {
        GetProjectData();

//        CheckLogOnStatus(false);

//        var count = 0;
//        var interval = @ViewBag.AlertInterval;
//        var timer = $.timer(
//			function () {
//			    if (count > 0) {
//			        CheckLogOnStatus(true);
//			    }
//                count++;
//			},
//			interval,
//			true
//		);

    });
</script>

<div class="row">
    <div class="span9">
        <div class="row-fluid">
            <div class="span2" style="text-align: left;">
                <label>
                    Engineer</label></div>
            <div class="span10" style="text-align: left;">
                <input id="inputEngineer" name="Engineer" type="text" value="" maxlength="200" size="16" />
            </div>
        </div>
        <div class="row-fluid">
            <div class="span2" style="text-align: left;">
                <label>
                    Project</label></div>
            <div class="span10" style="text-align: left;">
                <div id="ajaxDropDownListProject">
                    <select id="ddlProject" style="width: 580px;">
                        <option value='-1' title='Select a category...'>Select project...</option>
                        @if (Model.ProjectModels != null && Model.ProjectModels.Count() > 0)
                        {
                            foreach (var project in Model.ProjectModels)
                            {
                            //option selected="@project.Selected" value='@project.ProjectId' title='@project.ProjectDescription'
                            <option selected="@project.Selected" value='@project.ProjectId'>
                                @project.DisplayedName
                            </option>
                            }
                        }
                    </select>
                </div>
            </div>
        </div>
        <div style="text-align: right;">
            <input type="checkbox" id="chkOpenProjects" name="Load Open Project" />
            Show all open projects
            <input type="checkbox" id="chkClosedProjects" style="margin-left: 20px;" name="Load Closed Project" />
            Show all closed projects
        </div>
        <br />
        <div class="row-fluid">
            <div class="row-fluid">
                <div class="span2" style="text-align: left;">
                    <label>
                        Lead Engineer</label></div>
                <div class="span3" style="text-align: left;">
                    <input id="inputLeadEngineer" name="Lead Engineer" type="text" value="" maxlength="200"
                        size="16" />
                </div>
                <div class="span7">
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="row-fluid">
                                <div class="span6">
                                    <label>
                                        To Start</label>
                                </div>
                                <div class="span6">
                                    <input id="inputToStart" name="toStart" type="text" class="datepicker" size="8" />
                                </div>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="row-fluid">
                                <div class="span6">
                                    <label>
                                        To Finish</label>
                                </div>
                                <div class="span6">
                                    <input id="inputToFinish" name="toFinish" type="text" class="datepicker" size="8" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>'

        <div class="row-fluid">
            <div class="span2" style="text-align: left;">
                <label>
                    Visible Mngs</label></div>
            <div class="span3" style="text-align: left;">
                <select id="ddlEngineers" style="width: 165px;">
                    <option value='-1' title='Select an engineer...'>Select engineer...</option>
                    @if (Model.ProjectUserModels != null && Model.ProjectUserModels.Count() > 0)
                    {
                        foreach (var user in Model.ProjectUserModels)
                        {
                        <option value='@user.Id' title='@user.Name'>
                            @user.Name
                        </option>
                        }
                    }
                </select>
            </div>
            <div class="span7" style="text-align: left;">
                <div class="row-fluid">
                    <div class="span6">
                        <div class="row-fluid">
                            <div class="span6">
                                <label>
                                    Project Status</label>
                            </div>
                            <div class="span6">
                                <input id="inputStatus" name="status" type="text" value="" size="8" />
                            </div>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="row-fluid">
                            <div class="span6">
                                <label>
                                    Completed</label>
                            </div>
                            <div class="span6">
                                <input id="inputCompleted" name="completed" type="text" value="" size="8" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="span3">
        <div style="color: #222; font-weight: bold; padding-bottom: 7px;">
            Other engineers assigned to this project:</div>
        <div style="height: 120px; overflow-x: auto;">
            <div id="ajaxListOtherEngineers">
            </div>
        </div>
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="span9">
        <fieldset style="height: 570px;">
            <legend>Engineering Tasks</legend>
@*            <div id="ajaxGridCategory">
            </div>*@
            <div id="ajaxGridTask">
            </div>
            <div>
                <button id="btnResumePreviousTask" class="btn actButtons" name="resumebtn" style="height: 30px;
                    width: 250px;">
                    Resume Previous Project Task</button>
            </div>
        </fieldset>
        <div class="span2" style="text-align: right; float: right;">
            @Html.ActionLink("Free Entry", "Index", "FreeEntry", new { isAdminRole = ViewBag.IsAdminRole }, new { @class = "btn actButtons", @id = "btnFreeEntry" })
        </div>
    </div>
    <div class="span3">
        <fieldset class="well">
            <legend>Log on to Other Activity</legend>
            @Html.ActionLink("ETR", "Index", "ETR", null, new { @class = "btn actButtons", @id = "btnEtr" })

            <a class="btn actButtons" id="btnEngDeptSupportMisc">Eng Dept Support/Misc</a> 
            <a class="btn actButtons" id="btnProductionSupport">Production Support</a> 
            <a class="btn actButtons"
                id="btnTechnicalSupport">Technical Support</a> <a class="btn actButtons" id="btnSalesSupport">
                    Sales Support</a> <a class="btn actButtons" id="btnPurchasingSupport">Purchasing Support</a>
            <a class="btn actButtons" id="btnComputer">Computer</a> <a class="btn actButtons"
                id="btnTraining">Training</a> <a class="btn actButtons" id="btnGeneralMeeting">General
                    Meeting</a> <a class="btn actButtons" id="btnRD">R & D</a> <a class="btn actButtons"
                        id="btnEndOfDay">End of Day</a>
        </fieldset>
        <fieldset class="well">
            @Html.ActionLink("Holidays/Sickness", "Index", "ETR", null, new { @class = "btn actButtons" })
        </fieldset>
    </div>
</div>
<div class="row">
    <div class="right">
        LastTask : @ViewBag.LastActivity</div>
</div>
<div class="info row">
    <div class="span3">
        User ID: @ETL.Web.CustomCredential.ETLCredential.UserId</div>
    <div class="span5" id="bottomMes">
        @ViewBag.TimeSpentStatus
    </div>
    <div class="span4">
        Program Modified 19/12/2012 6:34</div>
</div>

